﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="duan_bianji.aspx.cs" Inherits="Default3" Title="编辑燃油基础库" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">

        .style7
        {
            font-size: small;
            text-align: left;
            width: 80%;
            float: left;
            display: inline;
        }
        .style21
        {
            font-size: small;
        }
        .right
        {
            width: 18%;
            float: right;
        }
        </style>
</head>
<body background="images/login-bg.jpg">
    <form id="form1" runat="server">
    <div style="text-align: center">
    
    <div class="style7">
    
        <span>当前位置：</span><asp:HyperLink ID="HyperLink1" runat="server" 
            NavigateUrl="~/index.aspx" style="color: #000000" 
            ToolTip="点击返回主页面">主页面</asp:HyperLink>
        <span>→ 编辑</span>燃油基础库<br class="style7" />
        <br /></div>
        <div class="right">
            <br />
        </div>
        <br />
        <br /><b>
        <br />
        待审批的计划单列表<br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id" 
        DataSourceID="SqlDataSource1" EmptyDataText="没有待审批的计划单" 
        EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
        style="text-align: center; font-size: small" 
            onrowdatabound="GridView1_RowDataBound" onrowdeleted="GridView1_RowDeleted" 
            onrowdeleting="GridView1_RowDeleting" PageSize="30">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" />
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="mingcheng" HeaderText="燃油种类" 
                    SortExpression="mingcheng" >
                </asp:BoundField>
                <asp:BoundField DataField="danjia" HeaderText="单价" 
                SortExpression="danjia" >
                </asp:BoundField>
                <asp:BoundField DataField="lei" HeaderText="类别" SortExpression="lei" >
                </asp:BoundField>
                                <asp:BoundField DataField="px" HeaderText="排序" 
                    SortExpression="px" >
                                </asp:BoundField>
                <asp:CommandField ShowEditButton="True" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>" 
            DeleteCommand="DELETE FROM [ranyou] WHERE [id] = @id" 
            InsertCommand="INSERT INTO [ranyou] ([mingcheng], [danjia], [lei], [px]) VALUES (@mingcheng, @danjia, @lei, @px)" 
            SelectCommand="SELECT * FROM [ranyou] ORDER BY [px]" 
            
            
            
            UpdateCommand="UPDATE [ranyou] SET [mingcheng] = @mingcheng, [danjia] = @danjia, [lei] = @lei, [px] = @px WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="mingcheng" Type="String" />
                <asp:Parameter Name="danjia" Type="Decimal" />
                <asp:Parameter Name="lei" Type="String" />
                <asp:Parameter Name="px" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="mingcheng" Type="String" />
                <asp:Parameter Name="danjia" Type="Decimal" />
                <asp:Parameter Name="lei" Type="String" />
                <asp:Parameter Name="px" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="id" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
            EnableModelValidation="True" Height="50px" style="font-size: small" 
            Width="225px">
            <Fields>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="mingcheng" HeaderText="燃油种类" 
                    SortExpression="mingcheng" />
                <asp:BoundField DataField="danjia" HeaderText="单价" SortExpression="danjia" />
                <asp:BoundField DataField="lei" HeaderText="类别" SortExpression="lei" />
                <asp:BoundField DataField="px" HeaderText="排序" SortExpression="px" />
                <asp:CommandField ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
        </b>
    
    </div>
    </form>
    <p class="style21" style="TEXT-ALIGN: center">
        &nbsp;<br />
        &nbsp;安康供电段信息中心制作 2012</p>
</body>
</html>
